#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int i, num = 0, m;
	for (i = 1; i <= 2019; i++)
	{
		m = i;
		while (m != 0)
		{
			if (m % 10 == 9)
			{
				num++;
			}
			m /= 10;
		}
	}
	printf("%d", num);
	return 0;
}

#include<stdio.h>
void bubblesort(int arr[])
{
	int i, j, tem, flag = 1;
	for(j=0;j<10;j++)
	{
		flag = 0;
		for (i = 0; i < 9-j; i++)
		{
			if (arr[i] > arr[i + 1])
			{
				tem = arr[i];
				arr[i] = arr[i + 1];
				arr[i + 1] = tem;
				flag = 1;
			}
		}
	}
}